<?php
use yii\widgets\ActiveForm;
use common\helpers\Url;
use common\widgets\webuploader\Files;
use kartik\datetime\DateTimePicker;

$addon = <<< HTML
<div class="input-group-append">
    <span class="input-group-text">
        <i class="fas fa-calendar-alt"></i>
    </span>
</div>
HTML;

$this->title = $model->isNewRecord ? '创建' : '编辑';
$this->params['breadcrumbs'][] = ['label' => '产品管理', 'url' => ['index']];
//$this->params['breadcrumbs'][] = $this->title;
?>

<div class="row">
    <div class="col-lg-12">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title">产品管理</h3>
            </div>
            <?php $form = ActiveForm::begin([
                'fieldConfig' => [
                    'template' => "<div class='col-sm-2 text-right'>{label}</div><div class='col-sm-10'>{input}{hint}{error}</div>",
                ]
            ]); ?>
            <div class="box-body">
                <div class="col-lg-12">
                    <?= $form->field($model, 'name')->textInput(); ?>
                    <?= $form->field($model, 'name_code')->textInput(); ?>
                    <?= $form->field($model, 'code2')->textInput(); ?>
                    <?= $form->field($model, 'cate_id')->dropDownList($cateDropDownList) ?>
                    <?= $form->field($model, 'zoom_size')->textInput(); ?>
                    <?= $form->field($model, 'desc')->textarea(); ?>
                    <?= $form->field($model, 'contract_size')->textInput(); ?>
                    <?= $form->field($model, 'zoom_size')->textInput(); ?>
                    <?= $form->field($model, 'unit')->textInput(); ?>
                    <?= $form->field($model, 'unit_price')->textInput(); ?>
                    <?= $form->field($model, 'unit_step')->textInput(); ?>
                    <?= $form->field($model, 'overfee')->textInput(); ?>
                    <?= $form->field($model, 'servicefee')->textInput(); ?>
                    <?= $form->field($model, 'deposit')->textInput(); ?>
                    <?= $form->field($model, 'maxrise')->textInput(); ?>
                    <?= $form->field($model, 'minrise')->textInput(); ?>
                    <?= $form->field($model, 'maxlost')->textInput(); ?>
                    <?= $form->field($model, 'minlost')->textInput(); ?>
                    <?= $form->field($model, 'risk')->textInput(); ?>
                    <?= $form->field($model, 'risk_auto')->textInput(); ?>
                    <?= $form->field($model, 'sort')->textInput(); ?>
                    <?= $form->field($model, 'on_sale')->radioList(\common\enums\StatusEnum::$listOnSale); ?>
                    <?= $form->field($model, 'merchant_id')->hiddenInput()->label('') ?>

                </div>
            </div>
            <div class="box-footer text-center">
                <button class="btn btn-primary" type="submit">保存</button>
                <span class="btn btn-white" onclick="history.go(-1)">返回</span>
            </div>
            <?php ActiveForm::end(); ?>
        </div>
    </div>
</div>